<div class="panel panel-default panel-intro">
    
    <div class="panel-body">
        <form id="add-form" class="appmsg_form" role="form" data-toggle="validator" method="POST" action="">
            
        <div class="row">
            <div class="col-xs-4">
                <div class="material-items">
                    <div class="material-header">
                        {$currentWechatName}
                    </div>
                    <div class="material-body">
                        <div class="material_item item-1 active" data-aid="0" id="appmsg-item-0">
                            <div class="appmsg_thumb _thumb" style="background-image:url('/assets/img/circle.png');"></div>
                            <div class="appmsg_text _title">我是标题...</div>
                        </div>

                    </div>
                    <div class="material-footer">
                        <a href="javascript:;" class="newMaterial"><i>+</i> 新建消息</a>
                    </div>
                </div>
            </div>          
            <div class="col-xs-7">
                <div class="form-group">
                    <label for="c-title" class="control-label col-xs-12 col-sm-12">{:__('标题')}:</label>
                    <div class="col-xs-12 col-sm-12">
                        <input id="c-title" data-rule="required" class="form-control" name="title" type="text" value="">
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <label for="c-author" class="control-label col-xs-12 col-sm-12">{:__('作者')}:</label>
                    <div class="col-xs-12 col-sm-12">
                        <input id="c-author"  class="form-control" name="author" type="text" value="">
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <label for="c-image" class="control-label col-xs-12 col-sm-12">{:__('封面')}:(10M，支持bmp/png/jpeg/jpg)</label>
                    <div class="col-xs-12 col-sm-12">
                        <div class="input-group">
                            <input id="c-image" data-rule="required" class="form-control" name="thumb" type="text" value="">
                            <input type="hidden" name="thumb_media_id" value="" id="thumb_media_id">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg,image/bmp" data-url="{:url('ajax/wxupload')}" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right"></span>
                        </div>
                        <!-- <ul class="row list-inline faupload-preview" id="p-image"></ul> -->
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <label for="c-digest" class="control-label col-xs-12 col-sm-12">{:__('简介')}:</label>
                    <div class="col-xs-12 col-sm-12">
                        <textarea id="c-digest" class="form-control" name="digest"></textarea>
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-12">{:__('内容')}:</label>
                    <div class="col-xs-12 col-sm-12">
                        <textarea id="c-content" class="form-control editor" name="content"></textarea>
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <label for="c-content_source_url" class="control-label col-xs-12 col-sm-12">{:__('源文链接')}:</label>
                    <div class="col-xs-12 col-sm-12">
                        <input id="c-content_source_url" placeholder="http(s)://"  class="form-control" name="content_source_url" type="text" value="">
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 col-sm-12">
                        <input type="checkbox" value="1" name="need_open_comment"> 打开评论　　
                        <input type="checkbox" value="1" name="only_fans_can_comment"> 粉丝才可评论
                    </div>
                    <div style="clear: both;"></div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-12">{:__('同步至')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <select class="form-control selectpicker" multiple="true" name="wechat[]">
                        <?php foreach($wechats as $id=>$wxname):?>
                            <?php if($id != $curr_wechat_id):?>
                            <option value="{$id}">{$wxname}</option>
                            <?php endif;?>
                        <?php endforeach;?>
                        </select>
                    </div>
                </div>
                
                <div class="form-group layer-footer">
                    <label for="c-content_source_urls" class="control-label col-xs-12 col-sm-12">　</label>
                    <div class="col-xs-12 col-sm-12 ">
                        <button type="button" class="btn btn-success btn-embossed" id="_submit">{:__('OK')}</button>
                        <button type="reset" class="btn btn-default btn-embossed reset-btn">{:__('Reset')}</button>
                    </div>
                </div>
            </div>
                     
        </div>
    </form>
    </div>
</div>
<script type="text/javascript">
    var oldData = [];
</script>
<script type="text/html" id="_material_itme_html">
    <div class="material_item item-last active" id="appmsg-item-{_index}" data-aid="{_index}">
        <div class="item-last-body">
            <div class="appmsg-title">
                <strong class="_title">我是标题...</strong>
            </div>
            <div class="appmsg_thumb">
                <img class="_thumb" src="/assets/img/circle.png">
            </div>
        </div>
        <div class="remove-item">
            <span>
                <i class="fa fa-trash"></i>
            </span>
        </div>
    </div>
</script>
